<%@ Page  Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="System.Data" %>

<asp:Content ID="cHead" ContentPlaceHolderID="cphHead" runat="server">
    <% this.Page.Title = (string)ViewData["PageTitle"]; %>
</asp:Content>

<asp:Content ID="cMainContent" ContentPlaceHolderID="cphMainContent" runat="server">
<div id="member">
    <table width="100%" cellpadding="0" cellspacing="0" summary="Membres">
		<tr>
			<th class="borderHeader" width="20">#</th>
			<th class="borderHeader">Pseudo</th>
			<th class="borderHeader" width="70">Fonction</th>
			<th class="borderHeader" width="70">Section</th>
			<th class="borderHeader" width="70">Inscrit le</th>
			<th class="borderHeader">Totem</th>
			<th width="80">Site Web</th>
		</tr>
    <% int i = 0; %>
    <% foreach (DataRow user in ((DataTable)ViewData["dtUsers"]).Rows) { %>
    <% string cssClass = (i % 2 == 0) ? "white" : "blue"; %>
        <tr>
            <td class="<%= cssClass %>"><%= user["UserNumItem"].ToString() %></td>
            <td class="<%= cssClass %>"><%= Html.ActionLink(((string)user["UserName"]).UppercaseFirst(), "Details", new { controller = "Membres", ID = new Guid(user["UserID"].ToString()), Title = ((string)user["UserName"]).ParseUrl() })%></td>
            <td class="<%= cssClass %>"><%= user["Role"].ToString()%></td>
            <td class="<%= cssClass %>"><%= user["Section"].ToString()%></td>
            <td class="<%= cssClass %>"><%= user["CreationDate"].ToString()%></td>
            <td class="<%= cssClass %>"><%= user["Totem"].ToString()%></td>
            <td class="<%= cssClass %>">
                <% if (user["WebSite"].ToString() != string.Empty){ %>
                <a href="<%= user["WebSite"].ToString() %>" rel="external nofollow" class="extLink" target="_blank"><img alt="<%= user["WebSite"].ToString()%>" src="/Design/Images/SiteImages/spacer.gif"/></a>
                <% } %>
            </td>
        </tr>
    <% i++; %>
    <% } %>
    </table>
</div>
<div class="hr1"></div>
<%= Html.PagerLinks((int)ViewData["Page"],(int)ViewData["TotalPages"], "Index",new{ controller = "Membres"})%>
</asp:Content>

<asp:Content ID="cAdminMenu" runat="server" ContentPlaceHolderID="cphAdminMenu">
    <% if ((UserType)ViewData["UserType"] == UserType.Administrator) {  %>
    <ul id="adminMenu">
        <li class="create"><%= Html.ActionLink(ScoutNET.Resources.Membres_Index_ManageLink, "Manage", new { controller = "Membres", sectionName = (string)ViewData["AdminSection"] })%></li>
    </ul>
    <% } %>
</asp:Content>